#获取供应商信息（用于选择）
import json
from flask import request
from db_client import *

def get_supplier_select():
        suppliers = []
        vender_code = request.args.get('search')
        result = mysql_client.get_supplier(vender_code)
        for re in result:
                t = {
                        "id" : re[0],
                        "name" : re[1],
                }
                suppliers.append(t)
        data = {
                "suppliers" : suppliers
        }
        return json.dumps(data,ensure_ascii=False)